# Example integration workflow
from dtn_trust_calculation import DynamicTrustCalculator
from byzantine_robust_aggregation import ByzantineRobustAggregator

def federated_round(global_model, clients):
    # 1. Local training
    local_updates = [client.train(global_model) for client in clients]
    
    # 2. Trust computation
    trust_calc = DynamicTrustCalculator()
    reputations = {}
    for client in clients:
        reputations[client.id] = trust_calc.global_reputation(
            client.id, 
            client.current_trust, 
            timestamp
        )
    
    # 3. Robust aggregation
    aggregator = ByzantineRobustAggregator()
    weights = aggregator.dynamic_weighting(reputations, local_updates)
    new_global = aggregator.robust_aggregate(local_updates, weights)
    
    return new_global, reputations
